//package com.guonl.event.consume;
//
//import com.guonl.event.model.SyncSqlEvent;
//import com.guonl.plus.mapper.DataSqlExecuteMapper;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//import org.springframework.transaction.event.TransactionPhase;
//import org.springframework.transaction.event.TransactionalEventListener;
//
///**
// * 简单模式
// */
//@Slf4j
//@Component
//public class DataSqlConsume {
//
//    @Autowired
//    private DataSqlExecuteMapper dataSqlExecuteMapper;
//
//    //    @Lazy
////    @Async
//    @TransactionalEventListener(
//            fallbackExecution = true,
//            phase = TransactionPhase.AFTER_COMPLETION,
//            classes = SyncSqlEvent.class)
//    public void doAsyncSql(SyncSqlEvent sqlEvent) {
//        String sql = sqlEvent.getExecuteSql();
//        log.info("[doAsyncSql 订阅:{}] - [开始执行:{}]", "sql", sql);
//        dataSqlExecuteMapper.executeNativeUpdateSql(sql);
//    }
//
//
//}
//
//
